package com.ruoyi.dataserver.line.utils;

import lombok.Data;

import java.util.List;

/**
 * @ProjectName intelligent-city
 * @Package com.lab.dataserver.line.utils
 * @ClassName PageUtil
 * @Description 分页工具类
 * @Company lab
 * @Author zgq
 * @Date 2020/7/16 17:28
 * @UpdateUser
 * @UpdateDate
 * @UpdateRemark
 * @Version 1.0.0
 */
@Data
public class PageUtil {

    /**
     * 当前页数
     */
    private Long current;

    /**
     * 每页条数
     */
    private Long size;

    /**
     * 总条数
     */
    private Long total;

    /**
     * 返回数据
     */
    private List records;

    /**
     * 总页数
     */
    private Long pages;

    public PageUtil(Long current, Long size, Long total) {
        this.current = current;
        this.size = size;
        this.total = total;
        this.pages = (total + size - 1) / size;
    }
}
